package com.study.manage.dal;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import com.study.manage.domain.EvaluateApplyTeamDetail;
import com.study.manage.domain.enumm.LiveDieState;

public interface EvaluateApplyTeamDetailRepository
        extends PagingAndSortingRepository<EvaluateApplyTeamDetail, Long> {

    Page<EvaluateApplyTeamDetail> findByEvaluateApplyIdAndState(Long evaluateApplyId,
            LiveDieState state, Pageable pageable);

    @Modifying
    @Query("update EvaluateApplyTeamDetail set state=:state where evaluateApplyTeamId=:evaluateApplyTeamId")
    void updateSetStateByEvaluateApplyTeamId(@Param("state") LiveDieState state,
            @Param("evaluateApplyTeamId") Long evaluateApplyTeamId);


    List<EvaluateApplyTeamDetail> findByEvaluateApplyTeamIdAndState(Long evaluateApplyTeamId,
            LiveDieState state);



}
